//-------------------------------------------------------------------
//	Copyright (c) 2012-2014 Zhirnov Andrey
//	This file is part of the "UXGEN-ES" project.
//	See copyright notice in "Engine.h".
//-------------------------------------------------------------------

#pragma once

#include "Graphics/GLshell/VertexAttribs.h"

namespace Engine
{
namespace Primitives
{
	using namespace Graphics;


	//
	// Vertex 2D
	//

	struct Vertex2D
	{
		vec2		position;
		vec2		texcoord;
		color4u		color;
		///
		Vertex2D () {}
		
		Vertex2D (const vec2 &pos, const vec2 &texc, const color4u &color) :
			position(pos), texcoord(texc), color(color)
		{}

		static GLVertexAttribs  GetAttribs ()
		{
			return GLVertexAttribs()
				.Add( &Vertex2D::position )
				.Add( &Vertex2D::texcoord )
				.Add( &Vertex2D::color )
				.SetStride( sizeof(Vertex2D) )
				.Build();
		}

		static TypeId_t GetTypeId ()
		{
			return TypeId< Vertex2D >();
		}
	};



	//
	// LineVertex2D
	//

	struct LineVertex2D
	{
		vec2	position;
		color4u	color;
		///
		LineVertex2D (const vec2 &pos, const color4u &color) :
			position(pos), color(color)
		{}

		static GLVertexAttribs  GetAttribs ()
		{
			return GLVertexAttribs()
				.Add( &LineVertex2D::position )
				.Add( &LineVertex2D::color )
				.SetStride( sizeof(LineVertex2D) )
				.Build();
		}

		static TypeId_t GetTypeId ()
		{
			return TypeId< LineVertex2D >();
		}
	};


}	// Primitives
}	// Engine